﻿using UnityEngine;
using System.Collections;

public class ForbidTargetScript : MonoBehaviour {

    public float speed;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () 
    {
        transform.Translate(Vector2.right * speed);
	}

    void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.tag == "boundary")
        {
            Destroy(gameObject);
        }

        if (collider.tag == "shoot")
        {
            PlayerScript.lives--;
            Destroy(gameObject);
        }
    }
}
